<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>
        <!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="dynsections.js"></script>
        <link rel="stylesheet" type="text/css" href="search/search.css" />
        <link rel="stylesheet" type="text/css" href="searchOverrides.css" />
        <script type="text/javascript" src="search/searchdata.js"></script>
        <script type="text/javascript" src="search/search.js"></script>
        <script type="text/javascript">
        /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
          $(document).ready(function() { init_search(); });
        /* @license-end */
        </script>
    </head>
    <body>
        <div id="banner-container">
            <div id="banner">
                <span id="sfml">SFML 2.6.1</span>
            </div>
        </div>
        <div id="content">
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1ThreadLocalPtr.html">ThreadLocalPtr</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsf_1_1ThreadLocalPtr-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">sf::ThreadLocalPtr&lt; T &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__system.html">System module</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Pointer to a thread-local variable.  
 <a href="classsf_1_1ThreadLocalPtr.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="ThreadLocalPtr_8hpp_source.html">SFML/System/ThreadLocalPtr.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for sf::ThreadLocalPtr&lt; T &gt;:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classsf_1_1ThreadLocalPtr.png" usemap="#sf::ThreadLocalPtr_3C_20T_20_3E_map" alt=""/>
  <map id="sf::ThreadLocalPtr_3C_20T_20_3E_map" name="sf::ThreadLocalPtr_3C_20T_20_3E_map">
<area href="classsf_1_1ThreadLocal.html" title="Defines variables with thread-local storage." alt="sf::ThreadLocal" shape="rect" coords="0,0,146,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8c678211d7828d2a8c41cb534422d649"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1ThreadLocalPtr.html#a8c678211d7828d2a8c41cb534422d649">ThreadLocalPtr</a> (T *value=NULL)</td></tr>
<tr class="memdesc:a8c678211d7828d2a8c41cb534422d649"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <br /></td></tr>
<tr class="separator:a8c678211d7828d2a8c41cb534422d649"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcbb45ae077df714bf9c61e936d97770"><td class="memItemLeft" align="right" valign="top">T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1ThreadLocalPtr.html#adcbb45ae077df714bf9c61e936d97770">operator*</a> () const</td></tr>
<tr class="memdesc:adcbb45ae077df714bf9c61e936d97770"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of unary operator *.  <br /></td></tr>
<tr class="separator:adcbb45ae077df714bf9c61e936d97770"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25646e1014a933d1a45b9ce17bab7703"><td class="memItemLeft" align="right" valign="top">T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1ThreadLocalPtr.html#a25646e1014a933d1a45b9ce17bab7703">operator-&gt;</a> () const</td></tr>
<tr class="memdesc:a25646e1014a933d1a45b9ce17bab7703"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of operator -&gt;  <br /></td></tr>
<tr class="separator:a25646e1014a933d1a45b9ce17bab7703"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81ca089ae5cda72c7470ca93041c3cb2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1ThreadLocalPtr.html#a81ca089ae5cda72c7470ca93041c3cb2">operator T*</a> () const</td></tr>
<tr class="memdesc:a81ca089ae5cda72c7470ca93041c3cb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Conversion operator to implicitly convert the pointer to its raw pointer type (T*)  <br /></td></tr>
<tr class="separator:a81ca089ae5cda72c7470ca93041c3cb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14dcf1cdf5f6b3bcdd633014b2b671f5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1ThreadLocalPtr.html">ThreadLocalPtr</a>&lt; T &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1ThreadLocalPtr.html#a14dcf1cdf5f6b3bcdd633014b2b671f5">operator=</a> (T *value)</td></tr>
<tr class="memdesc:a14dcf1cdf5f6b3bcdd633014b2b671f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator for a raw pointer parameter.  <br /></td></tr>
<tr class="separator:a14dcf1cdf5f6b3bcdd633014b2b671f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6792a6a808af06f0d13e3ceecf2fc947"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1ThreadLocalPtr.html">ThreadLocalPtr</a>&lt; T &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1ThreadLocalPtr.html#a6792a6a808af06f0d13e3ceecf2fc947">operator=</a> (const <a class="el" href="classsf_1_1ThreadLocalPtr.html">ThreadLocalPtr</a>&lt; T &gt; &amp;right)</td></tr>
<tr class="memdesc:a6792a6a808af06f0d13e3ceecf2fc947"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator for a <a class="el" href="classsf_1_1ThreadLocalPtr.html" title="Pointer to a thread-local variable.">ThreadLocalPtr</a> parameter.  <br /></td></tr>
<tr class="separator:a6792a6a808af06f0d13e3ceecf2fc947"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename T&gt;<br />
class sf::ThreadLocalPtr&lt; T &gt;</div><p>Pointer to a thread-local variable. </p>
<p><a class="el" href="classsf_1_1ThreadLocalPtr.html" title="Pointer to a thread-local variable.">sf::ThreadLocalPtr</a> is a type-safe wrapper for storing pointers to thread-local variables.</p>
<p>A thread-local variable holds a different value for each different thread, unlike normal variables that are shared.</p>
<p>Its usage is completely transparent, so that it is similar to manipulating the raw pointer directly (like any smart pointer).</p>
<p>Usage example: </p><div class="fragment"><div class="line">MyClass object1;</div>
<div class="line">MyClass object2;</div>
<div class="line"><a class="code hl_class" href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr&lt;MyClass&gt;</a> objectPtr;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> thread1()</div>
<div class="line">{</div>
<div class="line">    objectPtr = &amp;object1; <span class="comment">// doesn&#39;t impact thread2</span></div>
<div class="line">    ...</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> thread2()</div>
<div class="line">{</div>
<div class="line">    objectPtr = &amp;object2; <span class="comment">// doesn&#39;t impact thread1</span></div>
<div class="line">    ...</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main()</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// Create and launch the two threads</span></div>
<div class="line">    <a class="code hl_class" href="classsf_1_1Thread.html">sf::Thread</a> t1(&amp;thread1);</div>
<div class="line">    <a class="code hl_class" href="classsf_1_1Thread.html">sf::Thread</a> t2(&amp;thread2);</div>
<div class="line">    t1.launch();</div>
<div class="line">    t2.launch();</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="ttc" id="aclasssf_1_1ThreadLocalPtr_html"><div class="ttname"><a href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr</a></div><div class="ttdoc">Pointer to a thread-local variable.</div><div class="ttdef"><b>Definition</b> <a href="ThreadLocalPtr_8hpp_source.html#l00041">ThreadLocalPtr.hpp:42</a></div></div>
<div class="ttc" id="aclasssf_1_1Thread_html"><div class="ttname"><a href="classsf_1_1Thread.html">sf::Thread</a></div><div class="ttdoc">Utility class to manipulate threads.</div><div class="ttdef"><b>Definition</b> <a href="Thread_8hpp_source.html#l00048">Thread.hpp:49</a></div></div>
</div><!-- fragment --><p><a class="el" href="classsf_1_1ThreadLocalPtr.html" title="Pointer to a thread-local variable.">ThreadLocalPtr</a> is designed for internal use; however you can use it if you feel like it fits well your implementation. </p>

<p class="definition">Definition at line <a class="el" href="ThreadLocalPtr_8hpp_source.html#l00041">41</a> of file <a class="el" href="ThreadLocalPtr_8hpp_source.html">ThreadLocalPtr.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a8c678211d7828d2a8c41cb534422d649" name="a8c678211d7828d2a8c41cb534422d649"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c678211d7828d2a8c41cb534422d649">&#9670;&#160;</a></span>ThreadLocalPtr()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr</a>&lt; T &gt;::ThreadLocalPtr </td>
          <td>(</td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>value</em> = <code>NULL</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Default constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>Optional value to initialize the variable </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a81ca089ae5cda72c7470ca93041c3cb2" name="a81ca089ae5cda72c7470ca93041c3cb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81ca089ae5cda72c7470ca93041c3cb2">&#9670;&#160;</a></span>operator T*()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr</a>&lt; T &gt;::operator T* </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Conversion operator to implicitly convert the pointer to its raw pointer type (T*) </p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the actual object </dd></dl>

</div>
</div>
<a id="adcbb45ae077df714bf9c61e936d97770" name="adcbb45ae077df714bf9c61e936d97770"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adcbb45ae077df714bf9c61e936d97770">&#9670;&#160;</a></span>operator*()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T &amp; <a class="el" href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr</a>&lt; T &gt;::operator* </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Overload of unary operator *. </p>
<p>Like raw pointers, applying the * operator returns a reference to the pointed-to object.</p>
<dl class="section return"><dt>Returns</dt><dd>Reference to the thread-local variable </dd></dl>

</div>
</div>
<a id="a25646e1014a933d1a45b9ce17bab7703" name="a25646e1014a933d1a45b9ce17bab7703"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25646e1014a933d1a45b9ce17bab7703">&#9670;&#160;</a></span>operator-&gt;()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T * <a class="el" href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr</a>&lt; T &gt;::operator-&gt; </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Overload of operator -&gt; </p>
<p>Similarly to raw pointers, applying the -&gt; operator returns the pointed-to object.</p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the thread-local variable </dd></dl>

</div>
</div>
<a id="a6792a6a808af06f0d13e3ceecf2fc947" name="a6792a6a808af06f0d13e3ceecf2fc947"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6792a6a808af06f0d13e3ceecf2fc947">&#9670;&#160;</a></span>operator=() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1ThreadLocalPtr.html">ThreadLocalPtr</a>&lt; T &gt; &amp; <a class="el" href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsf_1_1ThreadLocalPtr.html">ThreadLocalPtr</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>right</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assignment operator for a <a class="el" href="classsf_1_1ThreadLocalPtr.html" title="Pointer to a thread-local variable.">ThreadLocalPtr</a> parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">right</td><td><a class="el" href="classsf_1_1ThreadLocalPtr.html" title="Pointer to a thread-local variable.">ThreadLocalPtr</a> to assign</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to self </dd></dl>

</div>
</div>
<a id="a14dcf1cdf5f6b3bcdd633014b2b671f5" name="a14dcf1cdf5f6b3bcdd633014b2b671f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14dcf1cdf5f6b3bcdd633014b2b671f5">&#9670;&#160;</a></span>operator=() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1ThreadLocalPtr.html">ThreadLocalPtr</a>&lt; T &gt; &amp; <a class="el" href="classsf_1_1ThreadLocalPtr.html">sf::ThreadLocalPtr</a>&lt; T &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assignment operator for a raw pointer parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>Pointer to assign</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to self </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="ThreadLocalPtr_8hpp_source.html">ThreadLocalPtr.hpp</a></li>
</ul>
</div><!-- contents -->
        </div>
        <div id="footer-container">
            <div id="footer">
                SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
                Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
            </div>
        </div>
    </body>
</html>
